package com.ruoyi.livenuniappserver.api.memberUser.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.domain.CommonResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.livenuniappserver.api.memberUser.service.MemberUserService;
import com.ruoyi.server.api.memberUserManagement.domain.MemberUserManagement;
import com.ruoyi.server.api.memberUserManagement.mapper.MemberUserManagementMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName MemberUserController
 * @Description TODO
 * @Author 26503
 * @Date 2024/6/28 11:10
 **/
@RestController
@Slf4j
@CrossOrigin
@RequestMapping("/memberUser")
public class MemberUserController {
    @Autowired
    private MemberUserService memberUserService;



    /*
     * @Author xy
     * @Description todo 会员头像查询
     * @Date 2023/11/28 18:56
     * @Return
     * @param
     */
    @GetMapping("/selectMemberHeadPortrait")
    public CommonResult selectMemberHeadPortrait(@RequestParam Integer userId){
        // 根据前端传过来的userId（会员id）来查询会员表id符合的数据
        String venueUniqueIdentifier = SecurityUtils.getLoginUser().getUser().getVenueUniqueIdentifier();
        List<MemberUserManagement> memberUserManagements = memberUserService.selectList(userId,venueUniqueIdentifier);
        return CommonResult.ok(memberUserManagements);
    }
}
